import 'package:tender_flutter/page/home/model/tender_detail_entity.dart';

tenderDetailEntityFromJson(TenderDetailEntity data, Map<String, dynamic> json) {
	if (json['date'] != null) {
		data.date = json['date'].toString();
	}
	if (json['contentUrl'] != null) {
		data.contentUrl = json['contentUrl'].toString();
	}
	if (json['province'] != null) {
		data.province = json['province'].toString();
	}
	if (json['isFocus'] != null) {
		data.isFocus = json['isFocus'];
	}
	if (json['city'] != null) {
		data.city = json['city'].toString();
	}
	if (json['checkTimes'] != null) {
		data.checkTimes = json['checkTimes'] is String
				? int.tryParse(json['checkTimes'])
				: json['checkTimes'].toInt();
	}
	if (json['view'] != null) {
		data.view = json['view'] is String
				? int.tryParse(json['view'])
				: json['view'].toInt();
	}
	if (json['annex1'] != null) {
		data.annex1 = json['annex1'].toString();
	}
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['title'] != null) {
		data.title = json['title'].toString();
	}
	if (json['content'] != null) {
		data.content = json['content'].toString();
	}
	if (json['annex'] != null) {
		data.annex = json['annex'].toString();
	}
	if (json['type'] != null) {
		data.type = json['type'] is String
				? int.tryParse(json['type'])
				: json['type'].toInt();
	}
	return data;
}

Map<String, dynamic> tenderDetailEntityToJson(TenderDetailEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['date'] = entity.date;
	data['contentUrl'] = entity.contentUrl;
	data['province'] = entity.province;
	data['isFocus'] = entity.isFocus;
	data['city'] = entity.city;
	data['checkTimes'] = entity.checkTimes;
	data['view'] = entity.view;
	data['annex1'] = entity.annex1;
	data['id'] = entity.id;
	data['title'] = entity.title;
	data['content'] = entity.content;
	data['annex'] = entity.annex;
	data['type'] = entity.type;
	return data;
}